﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="Questions.aspx.cs" Inherits="Admin_Questions" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ListView ID="listSections" DataSourceID="dsSections" DataKeyNames="Id" SelectedIndex="0" runat="server">
        <LayoutTemplate>
            <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
        </LayoutTemplate>
        <SelectedItemTemplate>
            <h2><%#Eval("Name") %></h2>
            <telerik:RadGrid ID="grid" DataSourceID="dsSiteQuestions" Skin="Telerik" AutoGenerateColumns="false" OnItemCommand="grid_ItemCommand" runat="server">
                <MasterTableView DataKeyNames="Id">
                    <Columns>
                        <acms:RadIndexColumn />
                        <telerik:GridBoundColumn HeaderText="Name" DataField="QuestionName" />
                        <acms:RadGridSequenceColumn HeaderText="Sequence" />
                        <telerik:GridButtonColumn ButtonType="LinkButton" Text="Remove" CommandName="Remove" ConfirmText="Are you sure?"/>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

            <h2>Unused</h2>
            <telerik:RadGrid ID="gridUnused" DataSourceID="dsQuestions" Skin="Telerik" AutoGenerateColumns="false" OnItemCommand="gridUnused_ItemCommand" runat="server">
                <MasterTableView DataKeyNames="Id">
                    <Columns>
                        <telerik:GridBoundColumn HeaderText="Name" DataField="Name" />
                        <telerik:GridButtonColumn ButtonType="LinkButton" Text="Include" CommandName="Include"/>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </SelectedItemTemplate>
        <ItemTemplate>
            <asp:LinkButton ID="lnkSelect" CommandName="Select" Text='<%#Eval("Name") %>' runat="server" />
        </ItemTemplate>
    </asp:ListView>
    <acms:EventDrivenDataSource ID="dsSections" runat="server" />    
    <acms:EventDrivenDataSource ID="dsSiteQuestions" runat="server" />
    <acms:EventDrivenDataSource ID="dsQuestions" runat="server" />
</asp:Content>

